<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<%@page import="sun.misc.Cleaner"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page import="com.model.GameModel"%>
<%@page import="com.dao.GameDao"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"
%>
<jsp:useBean id="g" class="com.model.GameModel" scope="request"/> 
<jsp:setProperty name="g" property="id"/> 
<%
	out.println(request.getAttributeNames());
	GameModel gameModel = new GameModel();
	GameDao gameDao = new GameDao();
	Integer id = Integer.parseInt(request.getParameter("codGame"));
	out.println("getId"+g.getId());
	gameModel = gameDao.getGameModel(id);
	

%>
<html>
	<head>
		<title>Tec Games - Pagina Teste</title>
		<link rel="stylesheet" type="text/css" href="../resources/css/default.css" />
		<link rel="shortcut icon" href="<%=request.getContextPath()%>/favicon.ico" type="image/x-icon" />
	</head>
	<body>
		<div id="container">
			<jsp:include page="../resources/header.jsp"/>
			<div id="content">
				<table cellspacing="10" cellpadding="10">
					<tr>
						<td width="105">
							<img alt="<%=gameModel.getTitulo()+"Image"%>" width="100" height="120" src="<%=request.getContextPath()+gameModel.getUrl()%>">
						</td>
						<td>
							<h2>
								<%=gameModel.getTitulo()%>
							</h2>
						</td>
					</tr>
					<tr>
						<td style="text-align: left;" colspan="2">
							<h3>Sinopse</h3>
							<div style="margin-left:5px;background-color:lightGray;padding:5px;border:1px solid;width:100%;">
								<p>
									<%=gameModel.getSinopse() %>	
								</p>
							</div>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<dl>
								<dt style="font-weight: bold;">Distribuidora</dt>
								<dd>
									<%
										if(gameModel.getDistribuidora()!=null){
											out.print(gameModel.getDistribuidora().getNome());							
										}else{
											out.print("Sem Info");							
										}
									%>
								</dd>
							</dl> 
						</td>
					</tr>
				</table>
				<a href="<%=request.getContextPath()%>/admin/listaGames.jsp">Voltar</a>
			</div>
		</div>
	</body>
</html>
